#include "stdafx.h"
#include "net/TCPServerParams.hpp"

NET_NAMESPACE_BEGIN

CTCPServerParams::CTCPServerParams()
	: m_threadIdleTime(10000000),
	m_maxThreads(0),
	m_maxQueued(64),
	m_threadPriority(CThread::PRIO_NORMAL)
{
}

CTCPServerParams::~CTCPServerParams()
{
}

void CTCPServerParams::setThreadIdleTime(const CTimeSpan& milliseconds)
{
	m_threadIdleTime = milliseconds;
}

void CTCPServerParams::setMaxThreads(int count)
{
	jh_assert (count > 0);

	m_maxThreads = count;
}

void CTCPServerParams::setMaxQueued(int count)
{
	jh_assert (count >= 0);

	m_maxQueued = count;
}

void CTCPServerParams::setThreadPriority(CThread::Priority prio)
{
	m_threadPriority = prio;
}

const CTimeSpan& CTCPServerParams::getThreadIdleTime() const
{
	return m_threadIdleTime;
}

int CTCPServerParams::getMaxThreads() const
{
	return m_maxThreads;
}

int CTCPServerParams::getMaxQueued() const
{
	return m_maxQueued;
}

CThread::Priority CTCPServerParams::getThreadPriority() const
{
	return m_threadPriority;
}


NET_NAMESPACE_END
